<?php

class Itvina_Controller_Action_Helper_Format extends Zend_Controller_Action_Helper_Abstract
{
	public $pluginLoader;

	public function __construct()
	{
		$this->pluginLoader = new Zend_Loader_PluginLoader ();
	}
	
	function direct($function, $params = array())
	{
		return $function ( func_get_args () );
	}

	public function time($value="",$format="")
	{
		return $this->_actionController->view->partial('index/format/time.phtml','admin',array($value,$format));	
	}

	public function int($value="")
	{
		return $this->_actionController->view->partial('index/format/int.phtml','admin',array($value,));	
	}

	public function float($value="")
	{
		return $this->_actionController->view->partial('index/format/float.phtml','admin',array($value,));	
	}
	
	public function noMark($string = "", $separator = "", $replace_char = "")
	{
		return $this->_actionController->view->partial('index/format/no-mark.phtml','admin',array('string'=>$string,'separator'=>$separator,'replace_char'=>$replace_char));
	}
	
	function stripTags($string)
	{
		$string = strip_tags ( $string );
		$string = str_replace ( array ("\r\n", "\n", "\r", "\t" ), '', $string );
		return $string;
	}
}
